home *** CD-ROM | disk | FTP | other *** search
- /*
- IMAGE MASTER IMAGES TO SOLARIZATION
- By J.L. White
- ©1994 Merlin's Software
-
- Image Master Script
-
- Batch Factory Batch Conversion Scripts are basically Arexx scripts that
- allow you to pass certain parameters to the external program you wish
- to use to convert the images from one format to another. You can pass
- five different strings from Batch Factory to the script by using the
- following commands:
-
- $N = This will pass the current selected filename.
- $P = This will tell Batch Factory to ask for a path to save new frames to.
- $# = This will pass the current frame number in the script.
- $T = This will pass the total number of frames in the script.
- $A = This will pass an offset number to be used to save frames with.
-
- NOTE: The following line is required to work as a Batch Factory Script:
-
- PARSE=$N $P $# $A $T
-
- */
-
- arg TheFile OutFile FrameNum AddNum TotalNum
- SaveNum = FrameNum + AddNum
- options results
-
- call Locate_IM
-
- address 'IM_Port'
- Buffers
- parse var result Name','Num','Fluff
- if Num = 0 then Killbuff 0
- Path = GetPathName(TheFile)
- Pic = GetFileName(TheFile)
- if FrameNum = 1 then do
- IMToFront
- ImagePath Path
- LoadAsPrimary Pic
- 'Gadgets "Do Operation On" "Entire Image",
- "Do Operation On" "Selected Area"';
- Selection = result;
- if Selection = 1 then do
- 'entire'
- end
- if Selection = 2 then do
- 'area'
- end
- 'SaveMask Ram:TempMaskSOL'
- end
- else do
- ImagePath Path
- LoadAsPrimary Pic
- 'LoadMask Ram:TempMaskSOL 1'
- end
- if OutFile = "SAME" then do
- Path = GetPathName(TheFile)
- Pic = GetFileName(TheFile)
- end
- else do
- Path = GetPathName(OutFile)
- Pic = GetFileName(OutFile)""right(SaveNum,3,'0')
- end
- Solar
- Rename 0 Pic
- ImagePath Path
- Save 0
- if FrameNum = TotalNum then do
- address command "delete >NIL: Ram:TempMaskSOL"
- end
- Exit
-
-
- GetFileName: procedure
- ARG CompleteName
- c = lastpos("/",CompleteName)
- if c = 0 then c = lastpos(":",CompleteName)
- return substr(CompleteName, c + 1)
-
- GetPathName: procedure
- ARG CompleteName
- c = lastpos("/",CompleteName)
- if c = 0 then c = lastpos(":",CompleteName)
- return left(CompleteName,c)
-
- Locate_IM:
- if (POS('IM_Port',SHOW('Ports')) = 0)
- then do
- address command 'run < nil: > nil: IMIMIM:IMF'
- address command 'wait 10'
- end
- return
-
-